﻿<%@ Page Language="C#" Trace="false" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="texts.aspx.cs" Inherits="TextsPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

	<script>
		function deleteTextDefinition(definitionName)
		{
			if (confirm("Deleting a text definition will delete all associated texts.\r\n\r\nReally delete " + definitionName + "?"))
			{
				$("#delete_" + definitionName).submit();
			}

		}

		function validateNewTextForm()
		{
			valDisplayer.hideAllValidationErrors();
			var noErrors = true;

			var nameElem = $("#<% =  NewNameTxt.ClientID %>");
			if (!nameElem.val())
			{
				valDisplayer.showValidationError("Required", nameElem, "below_right");
				noErrors = false;
			}
			return noErrors;
		}
	</script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">

	<form id="MainForm" runat="server">
	
		<h1>Translations</h1>
		<p>
			Here you can manage the text definitions and the actual texts.<br />
			You may find it easier to edit the texts directly in the project XML file, or use the export/import feature.
		</p>
		
		<h2>
			Create new text<br />
			<span class="explanatory">(start by giving the text definition a name - you will then be taken to a page where you can enter the actual texts)</span>
		</h2>
		
		<div class="clearfix">
			<div class="left">
				Name<br />
				<input type="text" id="NewNameTxt" name="NewNameTxt" runat="server" />
			</div>
			<div class="left" style="margin-left: 8px; margin-top: 14px;">

			 <asp:Button id="SaveTexBtn" OnClick="CreateTextDefinitionBtnClicked" Text="Save" runat="server"></asp:Button>
			</div>
		</div>
		
	</form>

	<h2 class="page">Existing texts</h2>

	<table class="grid translationsGrid">
	<asp:Literal ID="TextDefListLit" runat="server"></asp:Literal>
	</table>

</asp:Content>
